package com.ky.h5house.broadcastreceiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.ky.h5house.SplashActivity;


/**
 * 开机自启动广播
 */
public class AutoStartReceiver extends BroadcastReceiver {
    /**
     * 开机广播名称
     */
    static final String action_boot = "android.intent.action.BOOT_COMPLETED";

    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent.getAction().equals(action_boot)) {
            Intent main = new Intent(context, SplashActivity.class);
            main.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(main);
        }
    }
}
